{% extends "registration/base.html" %}

{% block title %}Log in{% endblock %}

{% block content %}
    <h1>Log in</h1>

    {% if form.errors %}
        <p class="error">Please correct the errors below:</p>
        {{ form.non_field_errors }}
    {% endif %}

    <form method="post" action="" class="form-input">
        {% csrf_token %}
        <input type="hidden" name="next" value="{{ next|default:"/" }}">

        <div>
            <label for="id_username">Username:</label>
            {% if form.username.errors %}
                <span class="error">{{ form.username.errors|join:", " }}</span>
            {% endif %}
            {{ form.username }}
        </div>
        <div>
            <label for="id_password">Password:</label>
            {% if form.password.errors %}
                <span class="error">{{ form.password.errors|join:", " }}</span>
            {% endif %}
            {{ form.password }}
        </div>
        <p>
            <input type="submit" value="Log in" class="cta"/>
        </p>
    </form>
{% endblock %}

{% block content-related %}
    <h1 class="visuallyhidden">Help</h1>
    <div role="complementary">
        <p>If you don't have an account, you can
            <a href="{% url 'registration_register' %}">sign up</a> for one.</p>

        <p>If you forgot your password, you can
            <a href="{% url 'auth_password_reset' %}">reset it</a>.</p>
    </div>
{% endblock %}
